<template>
	<div class="device-board">
		<div>
			<label>{{device.noseCode}}</label>
			<div></div>
			<button @click="itemClick(1)"><img /><label>{{$t('route.data_board_one')}}</label></button>
			<button @click="itemClick(2)"><img /><label>{{$t('route.data_board_two')}}</label></button>
		</div>

		<div>
			<router-view />
		</div>
	</div>
</template>

<script>
	import http from "../../js/http/http.js";
	import api from "../../js/http/api.js";
	import CommonUtils from "../../js/common/common-utils.js";
	export default {
		data() {
			return {
				device: {},
				index: 0
			};
		},
		methods: {
			itemClick(index) {
				if (index == 1) {
					this.$router.push({
						name: "MONITOR_1",
						params: {
							device: JSON.stringify(this.device)
						}
					});
				} else if (index == 2) {
					this.$router.push({
						name: "MONITOR-2",
						params: {
							device: JSON.stringify(this.device)
						}
					});
				}

			}
		},
		created() {
			this.device = JSON.parse(CommonUtils.getParam(this, 'device', 'setDevice'));
		}
	};
</script>
<style lang="scss" scoped>
	.device-board {
		color: #444444;
		font-size: 18px;
		padding-right: 20px;
		height: calc(100vh - 100px);
		// overflow: scroll;
		scrollbar-width: none;
		/* firefox */
		-ms-overflow-style: none;
		/* IE 10+ */
		overflow-x: hidden;
		overflow-y: auto;

		>div:nth-of-type(1) {
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-top: 20px;
			background-color: #ffffff;
			padding: 20px;
			border-radius: 5px;

			>label:nth-of-type(1) {
				font-weight: 600;
			}

			>div:nth-of-type(1) {
				width: 1px;
				background-color: #cccccc;
				height: 15px;
				margin: 0px 20px;
			}

			>button {
				margin-left: 10px;
				background-image: url(../../assets/img/customer-1.png);
				background-repeat: no-repeat;
				background-size: 100% 100%;
				padding: 5px 10px;
				border: 0px;
				display: flex;
				color: #ffffff;
				flex-direction: row;
				align-items: center;
				font-weight: 800;

				>img {
					margin-right: 7px;
					width: 15px;
					height: 15px;
					content: url(../../assets/img/customer-2.png);
				}

			}
		}
	}
</style>
